package com.helwen.restaurantbooking.datalayer.entities;

// Generated Jul 26, 2013 12:03:22 AM by Hibernate Tools 3.4.0.CR1
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "tbl_table", catalog = "restaurantbooking")
public class TblTable implements java.io.Serializable {

    private int tableNumber;
    private String area;
    private short status;
    private Set<TblBooking> tblBookings = new HashSet<TblBooking>(0);

    public TblTable() {
    }

    public TblTable(int tableNumber, String area, short status) {
        this.tableNumber = tableNumber;
        this.area = area;
        this.status = status;
    }

    public TblTable(int tableNumber, String area, short status,
            Set<TblBooking> tblBookings) {
        this.tableNumber = tableNumber;
        this.area = area;
        this.status = status;
        this.tblBookings = tblBookings;
    }

    @Id
    @Column(name = "table_number", unique = true, nullable = false)
    public int getTableNumber() {
        return this.tableNumber;
    }

    public void setTableNumber(int tableNumber) {
        this.tableNumber = tableNumber;
    }

    @Column(name = "area", nullable = false, length = 45)
    public String getArea() {
        return this.area;
    }

    public void setArea(String area) {
        this.area = area;
    }

    @Column(name = "status", nullable = false)
    public short getStatus() {
        return this.status;
    }

    public void setStatus(short status) {
        this.status = status;
    }

    @OneToMany(fetch = FetchType.LAZY, mappedBy = "tblTable")
    public Set<TblBooking> getTblBookings() {
        return this.tblBookings;
    }

    public void setTblBookings(Set<TblBooking> tblBookings) {
        this.tblBookings = tblBookings;
    }
}
